<div class="row">
	<div class="col-md-12 col-xs-12">
        <h1>
            <p class="pull-left">Gói sản phẩm <small>Quản lý các gói sản phẩm</small></p>
            <p class="pull-right">
                <a class="btn btn-success" href="<?php echo admin_page_url(PRODUCT_PACKET_SLUG.'/dang-ki-moi'); ?>">
                    <i class="glyphicon glyphicon-plus-sign"></i>
                    Danh sách đăng kí mới
                </a>
            </p>
        </h1>
    </div>
    <div class="col-md-12">
		<ol class="breadcrumb">
            <li><a href="<?php echo admin_page_url(); ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li>
            <li class="active"><i class="fa fa-table"></i> Danh sách các gói sản phẩm hiện có</li>
        </ol>
    </div>
</div>

<div class="row">
    <div class="col-md-12">
        <form id="panel-new-packet" role="form" method="POST" action="<?php echo admin_page_url(PRODUCT_PACKET_SLUG.'/them-moi'); ?>">
            <div class="form-group col-md-3 col-xs-12">
                <label for="packet-title">Tên</label>
                <input type="text" name="packet[title]" class="form-control" id="packet-title" placeholder="Tên"/>
            </div>
            <div class="form-group col-md-2 col-xs-12">
                <label for="packet-product-count">Số lượng sản phẩm</label>
                <input type="text" name="packet[product_count]" class="form-control" id="packet-product-count" placeholder="Số lượng sản phẩm"/>
            </div>
            <div class="form-group col-md-2 col-xs-12">
                <label for="packet-price">Đơn giá</label>
                <input type="text" name="packet[price]" class="form-control" id="packet-price" placeholder="Đơn giá"/>
            </div>
            <br/>
            <button type="button" class="btn-submit-update btn btn-primary"><i class='glyphicon glyphicon-plus-sign'></i> Thêm</button>
        </form>
    </div>
    <div class="col-md-12">
        <div class="table-responsive">
            <table class="table table-bordered table-hover tablesorter item-list" id='tb-packet' data-href='<?php echo admin_page_url(PRODUCT_PACKET_SLUG.'/cap-nhat'); ?>'>
                <thead>
                    <tr>
                        <th class="header"># <i class="fa fa-sort"></i></th>
                        <th class="header">Tên <i class="fa fa-sort"></i></th>
                        <th class="header">Số lượng sản phẩm <i class="fa fa-sort"></i></th>
                        <th class="header">Đơn giá <i class="fa fa-sort"></i></th>
                        <th class="header col-md-2">Hoạt động</th>
                    </tr>
                    <tr class="tr-temp2 hidden">
                        <th class="header bg-info index"></th>
                        <td class="input-packet-title"></td>
                        <td class="input-packet-product-count"></td>
                        <td class="input-packet-price"></td>
                        <td class="input-packet-delete-flg">
                            <input data-id="chk-del-new-" class="checkbox lb-toggle" data-name="delete_flg" type="checkbox" checked="checked" />
                            <label></label>
                        </td>
                    </tr>
                    <tr class="tr-temp hidden">
                        <th class="header bg-info index"></th>
                        <td class="input-packet-title">
                            <input type="text" name="title" class="form-control" />
                        </td>
                        <td class="input-packet-product-count">
                            <input type="text" name="product_count" class="form-control" />
                        </td>
                        <td class="input-packet-price">
                            <input type="text" name="price" class="form-control" />
                        </td>
                        <td class="input-packet-delete-flg col-md-2">
                            <div class="btn-group">
                                <button type="button" class="btn btn-primary btn-inline-update">
                                    <i class="glyphicon glyphicon-ok-sign"></i>
                                </button>
                                <button type="button" class="btn btn-default btn-inline-close" onclick="cancelUpdate();">
                                    <i class="glyphicon glyphicon-remove-sign"></i>
                                </button>
                            </div>
                            <input type="hidden" class="input-packet-id" name="id" />
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($aPacket as $index=>$packet) { ?>
                    <tr class="can-edit" data-id="<?php echo $this->encrypt->encode($packet->getId()); ?>">
                        <th class="header bg-info index"><?php echo $index+1; ?></th>
                        <td class="input-packet-title strong big-title"><?php echo $packet->getTitle(); ?></td>
                        <td class="input-packet-product-count"><?php echo $packet->getProductCount(); ?></td>
                        <td class="input-packet-price normal-price-style" data-price="<?php echo $packet->getPrice(); ?>">
                            <?php echo currency_format($packet->getPrice()); ?>
                        </td>
                        <td class="input-packet-delete-flg col-md-2">
                            <input id="chk-del-<?php echo $packet->getId(); ?>" class="checkbox lb-toggle chk-packet-flg" data-name="active_flg" type="checkbox"
                            <?php echo $packet->getDeletedAt()==NULL?"checked='checked'":""; ?>/>
                            <label for="chk-del-<?php echo $packet->getId(); ?>"></label>
                        </td>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="clearfix"></div>
</div>
